1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */ 
28 
29 module derelict.glib.ghmac;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import derelict.glib.gchecksum;
34 import core.stdc.config;
35 
36 extern (C):
37 
38 alias _GHmac GHmac;
39 
40 struct _GHmac;
41 
42 version(Derelict_Link_Static)
43 {
44     extern( C ) nothrow 
45     {
46         GHmac* g_hmac_new(GChecksumType digest_type, const(guchar)* key, gsize key_len);
47         GHmac* g_hmac_copy(const(GHmac)* hmac);
48         GHmac* g_hmac_ref(GHmac* hmac);
49         void g_hmac_unref(GHmac* hmac);
50         void g_hmac_update(GHmac* hmac, const(guchar)* data, gssize length);
51         const(gchar)* g_hmac_get_string(GHmac* hmac);
52         void g_hmac_get_digest(GHmac* hmac, guint8* buffer, gsize* digest_len);
53         gchar* g_compute_hmac_for_data(GChecksumType digest_type, const(guchar)* key, gsize key_len, const(guchar)* data, gsize length);
54         gchar* g_compute_hmac_for_string(GChecksumType digest_type, const(guchar)* key, gsize key_len, const(gchar)* str, gssize length);
55     }
56 }
57 else
58 {
59     extern( C ) nothrow 
60     {
61         alias da_g_hmac_new = GHmac* function(GChecksumType digest_type, const(guchar)* key, gsize key_len);													
62         alias da_g_hmac_copy = GHmac* function(const(GHmac)* hmac);																								
63         alias da_g_hmac_ref = GHmac* function(GHmac* hmac);																										
64         alias da_g_hmac_unref = void function(GHmac* hmac);																										
65         alias da_g_hmac_update = void function(GHmac* hmac, const(guchar)* data, gssize length);																
66         alias da_g_hmac_get_string = const(gchar)* function(GHmac* hmac);																						
67         alias da_g_hmac_get_digest = void function(GHmac* hmac, guint8* buffer, gsize* digest_len);																
68         alias da_g_compute_hmac_for_data = gchar* function(GChecksumType digest_type, const(guchar)* key, gsize key_len, const(guchar)* data, gsize length);	
69         alias da_g_compute_hmac_for_string = gchar* function(GChecksumType digest_type, const(guchar)* key, gsize key_len, const(gchar)* str, gssize length);	
70     }
71 
72     __gshared
73     {
74         da_g_hmac_new g_hmac_new; 
75         da_g_hmac_copy g_hmac_copy; 
76         da_g_hmac_ref g_hmac_ref; 
77         da_g_hmac_unref g_hmac_unref; 
78         da_g_hmac_update g_hmac_update; 
79         da_g_hmac_get_string g_hmac_get_string; 
80         da_g_hmac_get_digest g_hmac_get_digest; 
81         da_g_compute_hmac_for_data g_compute_hmac_for_data; 
82         da_g_compute_hmac_for_string g_compute_hmac_for_string; 
83     }
84 }